home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / Framewrk / FWPart / FWLnkSrc.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  5.9 KB  |  183 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWLnkSrc.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWLNKSRC_H
  11. #define FWLNKSRC_H
  12.  
  13. #ifndef FWLINK_H
  14. #include "FWLink.h"
  15. #endif
  16.  
  17. #ifndef FWSTDDEF_H
  18. #include "FWStdDef.h"
  19. #endif
  20.  
  21. #ifndef FWRUNTYP_H
  22. #include "FWRunTyp.h"
  23. #endif
  24.  
  25. #ifndef FWTCOLL_H
  26. #include "FWTColl.h"
  27. #endif
  28.  
  29. #ifndef FWODTYPS_H
  30. #include "FWODTyps.h"
  31. #endif
  32.  
  33. //========================================================================================
  34. //    Forward Declarations
  35. //========================================================================================
  36.  
  37. class ODStorageUnit;
  38. class ODLinkSource;
  39. class FW_CPresentation;
  40. class FW_CPart;
  41. class FW_CCloneInfo;
  42. class FW_CDataInterchange;
  43. class FW_CPromise;
  44. class FW_CLinkManager;
  45. class FW_CPrivCreateLinkSourceCommand;
  46.  
  47. //========================================================================================
  48. //    class FW_CLinkSource
  49. //========================================================================================
  50.  
  51. class FW_CLinkSource : public FW_CLink
  52. {
  53.   public:
  54.     FW_CLinkSource(Environment* ev, 
  55.                    ODUpdateID updateID, 
  56.                    FW_CPresentation* presentation);
  57.     virtual ~ FW_CLinkSource();
  58.     
  59.     virtual void        LinkEstablished(Environment* ev) = 0;    
  60.     virtual void        ExternalizeLinkContent(Environment* ev, ODStorageUnit* linkSU) = 0;
  61.  
  62.     virtual void        ContentUpdated(Environment* ev, 
  63.                                        ODUpdateID updateID,
  64.                                        FW_Boolean forceUpdate = FALSE);
  65.  
  66.     virtual FW_Boolean    HasEmbeddedFrame(Environment* ev, ODFrame* odEmbeddedFrame);
  67.     virtual FW_Boolean    IsOKtoUpdate(Environment* ev, FW_Boolean forceUpdate);
  68.  
  69.     virtual void        BreakLink(Environment* ev);
  70.     virtual void        RestoreLink(Environment* ev, FW_CPart* part);
  71.  
  72.     virtual FW_CFrame*    GetFrameToRevealLink(Environment* ev);
  73.     virtual void        RevealLinkSource(Environment* ev, FW_CFrame* frame);
  74.  
  75.     virtual void        DoExternalizeLink(Environment* ev, ODStorageUnit* storageUnit,
  76.                                           FW_CCloneInfo* cloneInfo) = 0;
  77.  
  78.     void                ExternalizeLink(Environment* ev, ODStorageUnit* storageUnit,
  79.                                         FW_CCloneInfo* cloneInfo);
  80.  
  81.     ODLinkSource*        GetODLinkSource(Environment* ev) const;
  82.     void                SetODLinkSource(Environment* ev, ODLinkSource* odLinkSource);
  83.  
  84.     FW_Boolean            IsPending(Environment* ev) const;
  85.     ODUpdateID            GetUpdateID(Environment* ev) const;
  86.     ODUpdateID            GetPendingID(Environment* ev) const;
  87.     void                SetPendingID(Environment* ev, ODUpdateID id);
  88.  
  89.     void                ShowLinkInfo(Environment* ev, FW_CFrame* frame, FW_CLinkManager* linkMgr);
  90.  
  91.      void                PrivLinkEstablished(Environment* ev);
  92.     virtual void         SetLinkPromise(Environment* ev, FW_CPromise* promise);
  93.  
  94.     FW_CPromise*         GetLinkPromise(Environment* ev) const;
  95.      FW_CPrivCreateLinkSourceCommand* PrivGetPendingCommand(Environment*) const;
  96.  
  97.      void PrivSetPendingCommand(Environment*, FW_CPrivCreateLinkSourceCommand* cmd);
  98.  
  99.     
  100.  
  101.   protected:
  102.     ODLinkSource*            fODLinkSource;
  103.     ODUpdateID                fUpdateID;
  104.     FW_CDataInterchange*    fDataInterchange;
  105.     FW_CPromise*            fLinkPromise;
  106.     
  107.   private:
  108.     ODUpdateID                fPendingID;            // changeID written to link spec
  109.     FW_CPrivCreateLinkSourceCommand* fPendingCommand;
  110. };
  111.  
  112. //========================================================================================
  113. //    Inlines
  114. //========================================================================================
  115.  
  116. //----------------------------------------------------------------------------------------
  117. //    FW_CLinkSource::GetODLinkSource
  118. //----------------------------------------------------------------------------------------
  119. inline ODLinkSource* FW_CLinkSource::GetODLinkSource(Environment*) const
  120. {
  121.     return fODLinkSource;
  122. }
  123.  
  124. //----------------------------------------------------------------------------------------
  125. //    FW_CLinkSource::IsPending
  126. //----------------------------------------------------------------------------------------
  127. inline FW_Boolean FW_CLinkSource::IsPending(Environment*) const
  128. {
  129.     return fODLinkSource == NULL;
  130. }
  131.  
  132. //----------------------------------------------------------------------------------------
  133. //    FW_CLinkSource::GetUpdateID
  134. //----------------------------------------------------------------------------------------
  135. inline ODUpdateID FW_CLinkSource::GetUpdateID(Environment*) const
  136. {
  137.     return fUpdateID;
  138. }
  139.  
  140. //----------------------------------------------------------------------------------------
  141. //    FW_CLinkSource::GetPendingID
  142. //----------------------------------------------------------------------------------------
  143. inline ODUpdateID FW_CLinkSource::GetPendingID(Environment*) const
  144. {
  145.     return fPendingID;
  146. }
  147.  
  148. //----------------------------------------------------------------------------------------
  149. //    FW_CLinkSource::SetPendingID
  150. //----------------------------------------------------------------------------------------
  151. inline void FW_CLinkSource::SetPendingID(Environment*, ODUpdateID id)
  152. {
  153.     fPendingID = id;
  154. }
  155.  
  156. //---------------------------------------------------------------------------------------
  157. //    FW_CLinkSource::GetLinkPromise
  158. //---------------------------------------------------------------------------------------
  159. inline FW_CPromise* FW_CLinkSource::GetLinkPromise(Environment*) const
  160. {
  161.     return fLinkPromise;
  162. }
  163.  
  164. //---------------------------------------------------------------------------------------
  165. //    FW_CLinkSource::GetPendingCommand
  166. //---------------------------------------------------------------------------------------
  167. inline FW_CPrivCreateLinkSourceCommand* FW_CLinkSource::PrivGetPendingCommand(Environment*) const
  168. {
  169.     return fPendingCommand;
  170. }
  171.  
  172.  
  173. //---------------------------------------------------------------------------------------
  174. //    FW_CLinkSource::SetPendingCommand
  175. //---------------------------------------------------------------------------------------
  176. inline void FW_CLinkSource::PrivSetPendingCommand(Environment*, FW_CPrivCreateLinkSourceCommand* cmd)
  177. {
  178.     fPendingCommand = cmd;
  179. }
  180.  
  181.  
  182. #endif
  183.